<%-- 
    Document   : verVersionesSubasta
    Created on : 19/03/2012, 03:42:53 PM
    Author     : user
--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ page language="java" contentType="text/html;UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
    <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="/Fonafe-Bienes/js/jquery.min.js"></script>
<script src="/Fonafe-Bienes/js/jquery.colorbox.js" type="text/javascript"></script>
<script type="text/javascript" src="/Fonafe-Bienes/js/jsindex.js"></script>
<link href="/Fonafe-Bienes/css/default.css" type="text/css" rel="stylesheet" />
<link href="/Fonafe-Bienes/css/colorbox.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/Fonafe-Bienes/js/paginacion/jquery.pagination.js"></script>
<link rel="stylesheet" type="text/css" href="/Fonafe-Bienes/css/paginacion/pagination.css" />

<script type="text/javascript">
    var items_per_page = 20;
        <s:set name="items_per_tabla" value="20" />
            (function($) {
                $(document).ready(function(){
                    initPagination();
                });

                function pageselectCallback(page_index, jq){
                    $('#Searchresult').empty();
                    var num_entries = $('#hiddenresult div.result').length;
                    var max_elem = Math.min((page_index+1) * items_per_page, num_entries);

                    for(var i=page_index*items_per_page;i<max_elem;i++) {
                        var new_content = $('#hiddenresult div.result:eq('+i+')').clone();
                        $('#Searchresult').append(new_content);
                    }
                    return false;
                }

                function initPagination() {
                    var num_entries = $('#hiddenresult div.result').length;
                    $("#Pagination").paginationList(num_entries, {
                        callback: pageselectCallback,
                        items_per_page: items_per_page,
                        num_display_entries: 4,
                        num_edge_entries: 2,
                        prev_text: '<<',
                        next_text: '>>'
                    });
                }

            })(jQuery);

    function popup(url,width_c,height_c){
        var window_top = (screen.height-height_c)/2;
        var window_left = (screen.width-width_c)/2;
        var caracteristicas = "height="+height_c+",width="+width_c+",scrollTo,resizable=no,scrollbars=1,location=0,menubar=no,status=no,directories=no,titlebar=no, top="+window_top+",left = "+window_left;
        window.open(url, 'Popup', caracteristicas);
    }
    function setDespachar(){
        //document.body.style.cursor = 'wait';
        //self.location.href="<s:url action="irAsignarSubasta" />";
        document.listaSubastaGLC.action = '<s:url action="irAsignarSubasta"></s:url>';
        document.listaSubastaGLC.submit();
    }
</script>
        <!--[if IE]>
		<script type="text/javascript" src="/Fonafe-Bienes/js/jforie.js"></script>
		<link href="/Fonafe-Bienes/css/forie.css" type="text/css" rel="stylesheet" />
	<![endif]-->
    </head>

        <body>
           <s:form action="irAsignarSubasta" method="post" name="listaSubastaGLC" theme="simple">
        <div id="header">
             <jsp:include page="/base/header_Login.jsp" flush="false"/>
             <jsp:include page="/base/menu_GLC.jsp" >
					<jsp:param name="parametro" value="subasta" />
		     </jsp:include>
            </div>

   <div id="main">
            <div id="cuerpo">
                
               <s:url action="regresarIrAsignarSubasta" id="regresarIrAsigSub" />
               <p style="margin-left: 120px;">
               <s:a href="%{regresarIrAsigSub}" class="botones_externos"> << Regresar </s:a></p>

              <div class="contenido_grilla">
                  <div>
                      <p align="center" style="color: #0054A5;font-size: 15px;font-weight: bold;padding: 0 0 10px;text-decoration: underline;">Historial de Versiones</p>
                  </div>
                        <s:if test="%{mensajeOk != null}">
                           <div class="msg-success" style="width: 330px;">
                                <s:property value="mensajeOk"/>
                           </div>
                        </s:if>
                        <s:if test="%{mensajeFail != null}">
                            <div class="msg-error" style="width: 330px;">
                                <s:property value="mensajeFail"/>
                            </div>
                        </s:if>
                    <div id="Searchresult">Cargando...</div>
                    <table cellpadding="0" cellspacing="0" class="tabla_bandeja">
                          <thead>
                             <tr>
                                  <th><span class="bg1"></span>Nro Subasta</th>
                                  <th>Fecha Act.</th>
                                  <th>Tipo Subasta</th>
                                  <th>Clase Subasta</th>
                                  <th>Estado</th>
                                  <th>Version</th>
                                  <th><span class="bg2"></span>Opci&oacute;n</th>
                              </tr>
                          </thead>
                        <div id="hiddenresult" style="display:none;">
                        <div class="result">
                          <tbody id="bodys_center">
                              <s:iterator value="listSubastas" var="bean">
                              <tr>
                                  <td><s:property value="nombre"/></td>
                                  <td><s:date name="fechCreacion" format="MMMMMMMMMM dd, yyyy"/></td>
                                  <td><s:property value="tipo"/></td>
                                  <td><s:property value="clase"/></td>
                                  <td><s:property value="estado"/></td>
                                  <td align="center">
                                      <s:property value="version"/>
                                  </td>
                                  <td>
                                      <s:url action="irVerVersionSubasta" id="verDetSubasta">
                                        <s:param name="idVersionSubasta" value="id"/>
                                        <s:param name="idSubasta" value="idSubasta"/>
                                        <s:param name="version" value="version"/>

                                      </s:url>
                                      <s:a href="%{verDetSubasta}" title="Ver este Item"><img height="20" src="/Fonafe-Bienes/img/ver.jpeg" alt="" /></s:a>
                                  </td>
                              </tr>
                              </s:iterator>
                          </tbody>
                        </div>
                       </div>
                      </table>
                     <s:if test="%{listSubastas.size() == 0}">
                     <div class="msg-noresult msg-info" style="width: 500px;" align="center">
                      Lo sentimos, no encontramos resultados para tu b&uacute;squeda,<br/>
                      intenta otra b&uacute;squeda, se pueden encontrar muchas cosas.
                      </div>
                     </s:if>
                      <br/>
                    <div id="Pagination" style="width:850px;margin-left: 120px;"></div>
                  </div>
          </div>

    </div>
          <jsp:include page="/base/footer.jsp" flush="false" />
          </s:form>
        </body>
</html>

